//
//  UIButton+BtnCategory.m
//  第三方文件
//
//  Created by wangyang on 2019/8/20.
//  Copyright © 2019 wangyang. All rights reserved.
//

#import "UIButton+BtnCategory.h"

@implementation UIButton (BtnCategory)


+ (UIButton *)ButtonWithText:(NSString *_Nullable)text superView:(UIView *)superView TextNormalcolor:(UIColor*_Nullable)TextNormalcolor  backgroundColor:(UIColor*_Nullable)backgroundColor fontSize:(CGFloat)fontSize addTarget:(nullable id)target selector:(SEL _Nullable )selector
{
    UIButton *btn = [[self alloc] init];
    btn.backgroundColor=backgroundColor;
    btn.titleLabel.font=[UIFont systemFontOfSize:fontSize];
    [btn setTitle:text forState:UIControlStateNormal];
    [btn setTitleColor:TextNormalcolor forState:UIControlStateNormal];
    [btn addTarget:target action:selector forControlEvents:UIControlEventTouchUpInside];
    [superView addSubview:btn];
    return btn;
}

@end
